package cn.nzp.core.openapi.client.common;

import com.alibaba.fastjson.annotation.JSONField;


@SuppressWarnings("serial")
public class BatchResponse extends BaseResponse{
	/**
	 * 成功数
	 */
	private int success = 0;
	/**
	 * 失败数
	 */
	private int fail = 0;
	/**
	 * 总数
	 */
	private int total = 0;
	
	@JSONField(name="all_success")
	boolean allSuccess = true;
	
	public boolean isAllSuccess() {
		return allSuccess;
	}
	public void setAllSuccess(boolean allSuccess) {
		this.allSuccess = allSuccess;
	}
	public BatchResponse() {
	}
	public BatchResponse(String retCode, String retMsg) {
		super(retCode, retMsg);
	}
	
	public int getSuccess() {
		return success;
	}
	public void setSuccess(int success) {
		this.success = success;
	}
	public int getFail() {
		return fail;
	}
	public void setFail(int fail) {
		this.fail = fail;
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	
	public void dealSuccess(int succ){
		this.success += succ;
		this.total += succ;
	}
	public void dealFail(int fai){
		this.fail += fai;
		this.total += fai;
		this.allSuccess = false;
	}

}
